package com.itheima.health.dao;

import com.itheima.health.pojo.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.Set;

public interface RoleMapper extends Mapper<Role> {
    @Select("select t1.* from t_role t1 join t_user_role t2 on t1.id = " +
            "t2.role_id join t_user t3 on t2.user_id = t3.id where t3.id = #{id}")
    Set<Role> findByUserId(@Param("id") Integer id);
}
